<template>
  <div class="all" v-if="list">
    <HomeComponent :contentList="contentList" />
  </div>
</template>

<script>
import HomeComponent from "@/components/HomeComponent.vue";
export default {
  components: {
    HomeComponent,
  },
  props: ["nowTag", "isGetTags"],
  data: () => {
    return {
      list: null,
    };
  },
  computed: {
    contentList() {
      return this.list;
    },
  },
  watch: {
    isGetTags() {
      this.getData();
    },
  },
  methods: {
    getData() {
      this.axios({
        method: "get",
        url: `${this.api.baseUrlData}/yunyuedu${this.nowTag.url}`,
      }).then((res) => {
        this.list = res.data.data.list;
      });
    },
  },
  created() {
    let time = setInterval(() => {
      if (!this.nowTag) return;
      this.getData();
      clearInterval(time);
    }, 500);
  },
};
</script>

<style lang="scss" scoped>
.all {
  width: 100%;
  box-sizing: border-box;
  padding: 0 0.15rem;
}
</style>